global.settings.connect('changed::app-folder-categories', Lang.bind(this, function() {
Main.queueDeferredWork(this._allAppsWorkId);
}));
+ global.settings.connect('changed::enable-app-monitoring',
+ Lang.bind(this, this._updateFrequentVisibility));
this._views = [];
}));
}
this._showView(Views.FREQUENT);
+ this._updateFrequentVisibility();
// We need a dummy actor to catch the keyboard focus if the
// user Ctrl-Alt-Tabs here before the deferred work creates
}
},
+ _updateFrequentVisibility: function() {
+ let enabled = global.settings.get_boolean('enable-app-monitoring');
+ this._views[Views.FREQUENT].control.visible = enabled;
+
+ let visibleViews = this._views.filter(function(v) {
+ return v.control.visible;
+ });
+ this._controls.visible = visibleViews.length > 1;
+
+ if (!enabled && this._views[Views.FREQUENT].view.actor.visible)
+ this._showView(Views.ALL);
+ },
+
_redisplay: function() {
this._redisplayFrequentApps();
this._redisplayAllApps();